num1 = 10  # 不可变数据类型
list1 = [1, 2, 3, 4, 5]


def f():
    num2 = 20  # 局部变量
    print("num2的值是", num2)
    global num1  # 函数里修改全局变量的值 一定要用global
    num1 = 20
    list1[2] = 8


print("num1的值是", num1)
f()
print("num1的值是", num1)
print("list1的值是", list1)
